# -*- coding: utf-8 -*-


import SimpleHTTPServer
import SocketServer
import threading
import webbrowser

class ServerHTTP: #Criacao do Servidor HTML
    
    def __init__(self):
        try:
            self.porta = 8000
            self.handler = SimpleHTTPServer.SimpleHTTPRequestHandler   
            self.httpd = SocketServer.TCPServer(("", self.porta), self.handler)  
            self.server_thread = threading.Thread(target=self.httpd.serve_forever)
            self.server_thread.setDaemon(True)
            self.server_thread.start()  

        except:
            print "ERRO DE LIGACAO DO SERVIDOR"

        webbrowser.open("http://localhost:8000/html/index.html".encode('utf-8'))
    pass
      
pass
